<?php
class guestbooklistAction extends security_normal {
	
	function action(){	
		$FormId=ceil($this->_getParamId(1));
		if($FormId<1)	$FormId=1;
		
		if(is_numeric($FormId)){
			global $conn;
			//查找
			$form=new model_Form();
			$form->setSubsection('WHERE type=\'guestbook\' AND isopen=1 AND form_id='.$FormId);
			$FormRS=$form->doSelectOne();

			if($FormRS){
				
			}else{
				MessageBox('错误信息',MICE_URL,'对不起,您查看的留言不存在或已经被删除');
				exit;
			}
		}else{
			MessageBox('参数错误',MICE_URL);
			exit;
		}

		$form2=new model_Form();
		$form2->setSubsection(' WHERE type=\'guestbook\' AND isopen=1 order by createdat DESC');
		$form2->setNrows(0);
		$form2->setOffset(20);
		$FormRS2=$form2->doSelectLimit();

		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileIndex');
		$smarty->assign('FormRS',$FormRS);
		$smarty->assign('FormRS2',$FormRS2);

		$filename = new getTPLFileName(__CLASS__);
		$tpl=$filename->TPLFileName;
		$smarty->display($tpl);
	}	
}
?>